package com.hxzy.service;

import com.hxzy.controller.mobile.address.req.AddressBookAddReq;
import com.hxzy.controller.mobile.address.req.AddressBookEditReq;
import com.hxzy.controller.mobile.address.resp.AddressBookResp;
import com.hxzy.entity.AddressBook;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author admin
* @description 针对表【address_book(地址管理)】的数据库操作Service
* @createDate 2024-02-21 11:30:40
*/
public interface AddressBookService extends IService<AddressBook> {

    /**
     * 获取默认收货地址
     * @return
     */
    AddressBookResp defaultAddressInfo();

    /**
     * 当前用户所有收货地址列表
     * @return
     */
    List<AddressBookResp> search();

    boolean editData(AddressBookEditReq req);

    boolean addData(AddressBookAddReq req);

    /**
     * 根据用户获取地址信息
     * @param addressId
     * @param userId
     * @return
     */
    AddressBookResp findById(Long addressId, long userId);

    /**
     * 设定默认收货地址
     * @param id
     * @return
     */
    boolean defaultAddress(Long id);

    /**
     * 移出
     * @param id
     * @return
     */
    boolean delete(long id);
}
